package others;

import java.util.Scanner;

public class TestScanner {
	public static void main(String[] args) {
		double max = 0;
		double min=0;
		double num=0;
		Scanner input=new Scanner(System.in);
		System.out.print("请输入一个数：（输入0结束）");
		while((num=input.nextDouble())!=0){
			System.out.print("请输入一个数：（输入0结束）");
			if(num>=max){
				max=num;
			}else{
				 if(min==0 || num<=min){
					 min=num;
				 }
			}
		}
		System.out.println("您输入的最大值是："+max+"!  您输入的最小值是："+min+"!");
	}
}
